<?php
/**
 * Partner Grid - Interface
 *
 * @package Nawa\MedicalStudy\MedicalCenter
 * @author Xavier VILAIN
 */

use Fox\Behaviors;
use Fox\Generator;
use Nawa\Messages;
use Fox\Html\Button;
use Fox\Grid;
use Fox\Html\Block;

$xview = Xview::instance();

$msid = $xview->val('msid');
$mcid = $xview->val('mcid');
$reload = $xview->val('reload');
// Load Grid Component
$block = $xview->component('medicalstudies','partners',array('msid' => $msid,'mcid' => $mcid ));
// Change Grid Behavior
$grid = $block->item('gPartners');

// Assign a partner to a center
$grid->footer()->item(Grid::BUTTON_ADD_RECORD)
			  ->label(Msg(Nawa\Messages::BUNDLE,Nawa\Messages::PARTNERS_ASSIGN));
// Unassign a partner from a center
$grid->footer()->item(Grid::BUTTON_DELETE_LINE)
				->color(Button::COLOR_RED)
			  ->label(Msg(Nawa\Messages::BUNDLE,Nawa\Messages::PARTNERS_UNASSIGN));
$grid->footer()->remove('assign');

// Ajax Reloading
if($reload) {
	// Add new User
	
	// Keep Posted Data
	
}
return $block;